package a3_p04_jw_kw.comparator;

import java.util.Comparator;

import org.jgrapht.Graph;
import org.jgrapht.graph.DefaultWeightedEdge;

import a1_p04_jw_kw.struct.Node;


//compares Nodes on their "attribute" attribute
public class EdgeComparator implements Comparator<DefaultWeightedEdge> {
	Graph<Node, DefaultWeightedEdge> g;
	
	public EdgeComparator(Graph<Node, DefaultWeightedEdge> g) {
		this.g = g;
		
	}

	@Override
	public int compare(DefaultWeightedEdge arg0, DefaultWeightedEdge arg1) {
		return Double.compare(g.getEdgeWeight(arg0), g.getEdgeWeight(arg1));
		
	}

}
